package com.bioroadlab.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * SampleTube entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sample_tube", catalog = "bioroadlab")
public class SampleTube implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 1L;

	private Integer sn;
	private SampleInfo sampleInfo;
	private String code;
	private String tailCode;

	// Property accessors
	@TableGenerator(table = "id_generator", name = "generator", pkColumnName = "name", pkColumnValue = "SampleTube", valueColumnName = "id", initialValue = 1, allocationSize = 1)
	@Id
	@GeneratedValue(generator = "generator", strategy = GenerationType.TABLE)
	@Column(name = "sn", unique = true, nullable = false)
	public Integer getSn() {
		return this.sn;
	}

	public void setSn(Integer sn) {
		this.sn = sn;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "sample", nullable = false)
	public SampleInfo getSampleInfo() {
		return this.sampleInfo;
	}

	public void setSampleInfo(SampleInfo sampleInfo) {
		this.sampleInfo = sampleInfo;
	}

	@Column(name = "code", length = 100)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "tail_code", length = 10)
	public String getTailCode() {
		return this.tailCode;
	}

	public void setTailCode(String tailCode) {
		this.tailCode = tailCode;
	}

}